package com.ywjt.platformbusiness.store.adapter;

import android.view.View;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ywjt.platformbusiness.R;
import com.ywjt.platformbusiness.store.model.SkuListModel;
import com.ywjt.platformbusiness.widget.CenterDialogEdit;
import com.ywjt.platformbusiness.widget.MyLayoutManager;

import java.util.ArrayList;
import java.util.List;

public class StoreAddSkuAdapter extends BaseQuickAdapter<SkuListModel, BaseViewHolder> {

    public StoreAddSkuAdapter(@Nullable List<SkuListModel> data) {
        super(R.layout.item_goodsadd_sku, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SkuListModel item) {
        helper.addOnClickListener(R.id.tvAdd);
        helper.setText(R.id.tvTitle,item.getTitle());
        RecyclerView rcCommon=helper.getView(R.id.rcCommon);
        MyLayoutManager myLayoutManager=new MyLayoutManager(mContext,true);
        StoreAddSkuChildAdapter   addSkuChildAdapter=new StoreAddSkuChildAdapter(item.getResult());
        rcCommon.setLayoutManager(myLayoutManager);
        rcCommon.setAdapter(addSkuChildAdapter);
    }
}